﻿using Domain.Entity.ord;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.PurchaseReturn_dService
{
    public class PurchaseReturn_dService : IPurchaseReturn_dService
    {
        private readonly IPurchaseReturn_dRepository purchaseReturn_DRepository;

        public PurchaseReturn_dService(IPurchaseReturn_dRepository purchaseReturn_DRepository)
        {
            this.purchaseReturn_DRepository = purchaseReturn_DRepository;
        }

        //添加退货明细
        public async Task<int> AddPurchaseReturn_d(PurchaseReturn_d purchaseReturn_D)
        {
            return await purchaseReturn_DRepository.AddPurchaseReturn_d(purchaseReturn_D);
        }


        //删除
        public async Task<int> DeletePurchaseReturn_d(int id)
        {
            return await purchaseReturn_DRepository.DeletePurchaseReturn_d(id);
        }


        //根据进货退货单与货品获取到主键id
        public async Task<int> Getid(int purtid, int procid)
        {
            return await purchaseReturn_DRepository.Getid(purtid, procid);
        }


        //根据purtId查询明细
        public async Task<List<PurchaseReturn_d>> GetPurchaseReturn_Ds(int purtId)
        {
            return await purchaseReturn_DRepository.GetPurchaseReturn_Ds(purtId);
        }

        //更新出库数
        public async Task<int> UpdateNum(int purtdid, int oknum, int nonum)
        {
            return await purchaseReturn_DRepository.UpdateNum(purtdid, oknum, nonum);
        }


        //修改
        public async Task<int> UpdatePurchaseReturn_d(PurchaseReturn_d purchaseReturn_D)
        {
            return await purchaseReturn_DRepository.UpdatePurchaseReturn_d(purchaseReturn_D);
        }

    }
}
